Skip to content

Fix multi-search with template doesn't return status code#16265

Merged
reta merged 3 commits intoopensearch-project:mainfrom
gaobinlong:fix_multisearch
Oct 14, 2024
Merged

Fix multi-search with template doesn't return status code#16265
reta merged 3 commits intoopensearch-project:mainfrom
gaobinlong:fix_multisearch

Conversation

@gaobinlong
Copy link
Copy Markdown
Contributor

Description

Currently the multi-search API does return the status code in each search response, but multi-search template API does not, these two APIs are very similar, we should make the response consistent, so this PR adds a status code field in each search response for the multi-search template API.

Related Issues

#11133

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Gao Binlong <gbinlong@amazon.com>
Signed-off-by: Gao Binlong <gbinlong@amazon.com>
@github-actions
Copy link
Copy Markdown
Contributor

❌ Gradle check result for 8ecb0c9: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@reta
Copy link
Copy Markdown
Contributor

reta commented Oct 11, 2024

Thanks @gaobinlong , we would need API changes [1] (and may be documentation updates if we have any) [2].

[1] https://github.com/opensearch-project/opensearch-api-specification
[2] https://github.com/opensearch-project/documentation-website/

@reta
Copy link
Copy Markdown
Contributor

reta commented Oct 12, 2024

I see now the msearch api and msearch template api uses same response schema: MultiSearchResult, so may no need to change it?

Thanks @gaobinlong. I just briefly looked at it, seems like MultiSearchResult has no status property? Or I am missing something?

@github-actions
Copy link
Copy Markdown
Contributor

❌ Gradle check result for 9778ed5: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@gaobinlong
Copy link
Copy Markdown
Contributor Author

I see now the msearch api and msearch template api uses same response schema: MultiSearchResult, so may no need to change it?

Thanks @gaobinlong. I just briefly looked at it, seems like MultiSearchResult has no status property? Or I am missing something?

status exists in each search response, the definition is here, the whole response of the API is like this:

{
  "took": 8,
  "responses": [
    {
      "took": 7,
      "timed_out": false,
      "_shards": {...},
      "hits": {...},
      "status": 200
    },
   {
      "took": 7,
      "timed_out": false,
      "_shards": {...},
      "hits": {...},
      "status": 200
    }
  ]
}

@reta
Copy link
Copy Markdown
Contributor

reta commented Oct 12, 2024

I see now the msearch api and msearch template api uses same response schema: MultiSearchResult, so may no need to change it?

Thanks @gaobinlong. I just briefly looked at it, seems like MultiSearchResult has no status property? Or I am missing something?

status exists in each search response, the definition is here, the whole response of the API is like this:

{
  "took": 8,
  "responses": [
    {
      "took": 7,
      "timed_out": false,
      "_shards": {...},
      "hits": {...},
      "status": 200
    },
   {
      "took": 7,
      "timed_out": false,
      "_shards": {...},
      "hits": {...},
      "status": 200
    }
  ]
}

Perfrect, thank you!

@github-actions
Copy link
Copy Markdown
Contributor

❌ Gradle check result for 9778ed5: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@dbwiddis
Copy link
Copy Markdown
Member

@github-actions
Copy link
Copy Markdown
Contributor

❌ Gradle check result for 9778ed5: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@github-actions
Copy link
Copy Markdown
Contributor

✅ Gradle check result for 9778ed5: SUCCESS

@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.07%. Comparing base (20536ee) to head (9778ed5).
Report is 3 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #16265      +/-   ##
============================================
+ Coverage     72.00%   72.07%   +0.06%     
- Complexity    64796    64828      +32     
============================================
  Files          5307     5307              
  Lines        302540   302544       +4     
  Branches      43708    43708              
============================================
+ Hits         217853   218052     +199     
+ Misses        66801    66646     -155     
+ Partials      17886    17846      -40     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@reta reta merged commit 55e98ed into opensearch-project:main Oct 14, 2024
@reta reta added v3.0.0 Issues and PRs related to version 3.0.0 v2.18.0 Issues and PRs related to version 2.18.0 labels Oct 14, 2024
@opensearch-trigger-bot
Copy link
Copy Markdown
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-16265-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 55e98ed2735d898d884295c00f869f5f3278c222
# Push it to GitHub
git push --set-upstream origin backport/backport-16265-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-16265-to-2.x.

@reta
Copy link
Copy Markdown
Contributor

reta commented Oct 14, 2024

@gaobinlong could you please backport to 2.x manually? thank you

gaobinlong added a commit to gaobinlong/OpenSearch that referenced this pull request Oct 14, 2024
…-project#16265)

* Fix multi-search with template doesn't return status code

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

* Modify changelog

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

---------

Signed-off-by: Gao Binlong <gbinlong@amazon.com>
dbwiddis pushed a commit that referenced this pull request Oct 15, 2024
…ode (#16265) (#16312)

* Fix multi-search with template doesn't return status code (#16265)

* Fix multi-search with template doesn't return status code

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

* Modify changelog

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

---------

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

* Format the code

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

---------

Signed-off-by: Gao Binlong <gbinlong@amazon.com>
dk2k pushed a commit to dk2k/OpenSearch that referenced this pull request Oct 16, 2024
…-project#16265)

* Fix multi-search with template doesn't return status code

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

* Modify changelog

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

---------

Signed-off-by: Gao Binlong <gbinlong@amazon.com>
dk2k pushed a commit to dk2k/OpenSearch that referenced this pull request Oct 17, 2024
…-project#16265)

* Fix multi-search with template doesn't return status code

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

* Modify changelog

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

---------

Signed-off-by: Gao Binlong <gbinlong@amazon.com>
dk2k pushed a commit to dk2k/OpenSearch that referenced this pull request Oct 21, 2024
…-project#16265)

* Fix multi-search with template doesn't return status code

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

* Modify changelog

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

---------

Signed-off-by: Gao Binlong <gbinlong@amazon.com>
akolarkunnu pushed a commit to akolarkunnu/OpenSearch that referenced this pull request Jan 21, 2025
…-project#16265)

* Fix multi-search with template doesn't return status code

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

* Modify changelog

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

---------

Signed-off-by: Gao Binlong <gbinlong@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 2.x Backport to 2.x branch backport-failed v2.18.0 Issues and PRs related to version 2.18.0 v3.0.0 Issues and PRs related to version 3.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants